﻿
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class Food : MonoBehaviour
{
    public Action RemoveFoodEvent;
    public readonly int score = 10;
    [SerializeField]
    private SpriteRenderer m_foodeTexture;
    public void SetColor(Color32 pColor)
    {
        m_foodeTexture.color = pColor;
    }
    public void SetSprite(Sprite pSprite)
    {
        m_foodeTexture.sprite = pSprite;
    }
    public void SetLocalPos(Vector3 pLocalPos)
    {
        this.transform.localPosition = pLocalPos;
    }
    public void SetLocalRotate(Quaternion pLocalRot)
    {
        this.transform.localRotation = pLocalRot;
    }
    public void BeEaton(Monster pMonster)
    {
        this.GetComponent<BoxCollider>().enabled = false;
        if (RemoveFoodEvent != null) RemoveFoodEvent.Invoke();
        Destroy(this.gameObject);
    }
}
